2614905e0bdd742d5b56b9b60f5b3a8887ff7aed,Android-code/app/src/main/java/com/vasilkoff/easyvpnfree/activity/HomeActivity.java,HomeActivity,initServerOnMap,#Layers#,174
Before Change
for (String countryName : countryList) {
for (Country country : countryLatLonList) {
if (countryName.equals(country.getCountryName())) {
LatLong position = new LatLong(country.getCapitalLatitude(), country.getCapitalLongitude());
Bitmap bitmap = AndroidGraphicFactory.convertToBitmap(ContextCompat.getDrawable(this, R.drawable.ic_server_full));
After Change
for (Country countryUnique : countryList) {
for (Country country : countryLatLonList) {
if (countryUnique.getCountryCode().equals(country.getCountryCode())) {
LatLong position = new LatLong(country.getCapitalLatitude(), country.getCapitalLongitude());
Bitmap bitmap = AndroidGraphicFactory.convertToBitmap(ContextCompat.getDrawable(this, R.drawable.ic_server_full));
MyMarker countryMarker = new MyMarker(position, bitmap, 0, -bitmap.getHeight() / 2, country) {
@Override
public boolean onTap(LatLong geoPoint, Point viewPosition,
Point tapPoint) {
if (contains(viewPosition, tapPoint)) {
onSelectCountry((Country)getRelationObject());
return true;
}
return false;
}
};
layers.add(countryMarker);
Drawable drawable = new BitmapDrawable(getResources(), BitmapGenerator.getTextAsBitmap(country.getCountryName(), 20, ContextCompat.getColor(this,R.color.mapNameCountry)));
Bitmap bitmapName = AndroidGraphicFactory.convertToBitmap(drawable);
Marker countryNameMarker = new Marker(position, bitmapName, 0, bitmapName.getHeight() / 3);